/**
 * Cascader 组件的主题配置
 * 
 * 基于企业级设计规范 (Cascader.json) 的完整配置
 * 级联选择器组件样式定义
 */

import type { ComponentToken } from 'antd/es/cascader/style';

// ========== 设计 Token 常量 ==========

/**
 * 尺寸相关 Token
 */
const SIZE_TOKENS = {
  controlWidth: 184,
  controlItemWidth: 111,
  dropdownHeight: 180,
} as const;

/**
 * 选项相关 Token
 */
const OPTION_TOKENS = {
  optionSelectedBg: '#e6f4ff',
  optionSelectedColor: '#1a1a1a',
  optionSelectedFontWeight: 600,
  optionPadding: '1px 12px',
  menuPadding: '4px',
} as const;

/**
 * Cascader 完整主题配置
 */
export const cascaderThemeConfig: Partial<ComponentToken> = {
  // ========== 尺寸配置 ==========
  controlWidth: SIZE_TOKENS.controlWidth,
  controlItemWidth: SIZE_TOKENS.controlItemWidth,
  dropdownHeight: SIZE_TOKENS.dropdownHeight,

  // ========== 选项配置 ==========
  optionSelectedBg: OPTION_TOKENS.optionSelectedBg,
  optionSelectedColor: OPTION_TOKENS.optionSelectedColor,
  optionSelectedFontWeight: OPTION_TOKENS.optionSelectedFontWeight,
  optionPadding: OPTION_TOKENS.optionPadding as any,
  menuPadding: OPTION_TOKENS.menuPadding as any,
};

export const getCascaderTheme = (
  customConfig?: Partial<ComponentToken>
): Partial<ComponentToken> => {
  return {
    ...cascaderThemeConfig,
    ...customConfig,
  };
};

export type { ComponentToken as CascaderComponentToken } from 'antd/es/cascader/style';

